<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Admin</title>
    <link rel="stylesheet" href="http://yui.yahooapis.com/pure/0.2.0/pure-min.css" />
    <link rel="stylesheet" href="/static/css/marketing.css" />
    <link rel="stylesheet" href="/static/css/wmd.css" />
    <link rel="stylesheet" href="/static/css/prettify.css" />
  </head>
  <body>
    <div class="content pure-g">
        <div class="header pure-u-1">
        <div class="pure-menu pure-menu-open pure-menu-fixed pure-menu-horizontal">
            <a class="pure-menu-heading" href="/">Vika's Blog</a>

            <ul>
                <li class="pure-menu-selected"><a href="/">Home</a></li>
                <li><a href="/about">About</a></li>
            </ul>
        </div>
        </div>
        <div class="splash pure-u-1"></div>
        <div class="content pure-u-1">
          <div class="pure-g">
            <div class="pure-u-1-6">some and some</div>
            <div class="pure-u-5-6">
                <form action="/admin/post{% if post %}?id={{ post.get_id() }}{% endif %}" method="POST" class="pure-form">
                <div class="pure-g">
                 <div class="pure-u-2-3">
                <fieldset>
                  <legend>Create New Post</legend>

                  <label for="inp_title">Title: </label>
                  <input type="text" id="inp_title" name="title" value="{{ post.title }}" placeholer="Title" />
                  <div class="wmd-panel">
                    <div id="wmd-button-bar"></div>
                    <textarea class="wmd-input" id="wmd-input" name="content">{{ post.content }}</textarea>
                 </div>
                 <label for="publish">
                     <input type="checkbox" id="publish" name="publish" {% if post.published %}checked="yes"{% endif %}>Publish
                 </label>
                 <button type="submit" class="pure-button notice">Save</button>
                 <div id="wmd-preview" class="wmd-panel wmd-preview"></div>
               </fieldset>
               </div>
               <div class="pure-u-1-3">
                   <label for="inp-selcat">Category:</label>
                   <select id="inp-selcat" name="category">
                       {% for c in category_list %}
                       <option value="{{ c.name }}" {% if post and  post.category and  c.name == post.category.name %}selected{% endif %}>{{ c.label }}</option>
                       {% endfor %}
                   </select><br/>
                   <label for="inp-tags">Tags:</label>
                   <input type="text" id="inp-tags" name="tags" value="{% if post %}{{ post.get_tags_str() }}{% endif %}" />
               </div>
               </div>
          </form>
            </div>
          </div>
        </div>

        <div class="footer pure-u-1">
        &copy;Vika. <img src="https://developers.google.com/appengine/images/appengine-silver-120x30.gif" alt="Powered by Google App Engine" />
        </div>
    <div>
    <script type="text/javascript" src="/static/javascript/Markdown.Converter.js"></script>
    <script type="text/javascript" src="/static/javascript/Markdown.Sanitizer.js"></script>
    <script type="text/javascript" src="/static/javascript/Markdown.Editor.js"></script>
    <script type="text/javascript" src="/static/javascript/editor.js"></script>
    <script type="text/javascript" src="/static/javascript/prettify.js"></script>
  </body>
</html>
